<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>回答问题</title>

<style>
.box{
    width:40%; margin-top:10%; margin:auto; padding:28px;
    height:30px; border:1px #111 solid;
    display:none;            /* 默认对话框隐藏 */
}
.box.show{display:block;} 

</style>
</head>  
<body> 
    
    <h2>xxx的问题</h2>
    <h3>Q:&nbsp;.......</h3>
    <input type="button" onClick="msgbox(1)" value="点击回答">

    <script>  
        function msgbox(n){
            document.getElementById('inputbox').style.display=n?'block':'none';     /* 点击按钮打开/关闭 对话框 */
        }
     </script>  
     
     <div id='inputbox' class="box">
        
        <input type="text">
        <input type="button" value="提交" onclick="msgbox(0); return false;">
        <input type="button" value="取消" onclick="msgbox(0); return false;" > 
     </div>
</body> 